package com.gistmap.sideline.util;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.AES;
import org.springframework.stereotype.Component;

@Component
public class PasswordUtil {

    public String translate(String password){
        AES aes = SecureUtil.aes("nicenicenicenice".getBytes());
        byte[] decrypt = aes.decrypt(password);
        String str = new String(decrypt);
        String realPassword = StrUtil.sub(str, 0,str.length()-5);
        return aes.encrypt(realPassword + "sidelinex").toString();
    }
}
